﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace DCT.View
{
    public class DisplayNameToTitleConverter : IMultiValueConverter
    {
        public object Convert(object[] value, Type typeTarget, object param, CultureInfo culture)
        {
            if (typeTarget == typeof(string))
            {
                string displayName = (string)value[0];
                bool isChanged = (bool)value[1];
                return isChanged ? displayName + "*" : displayName;
            }

            return null;
        }

        public object[] ConvertBack(object value, Type[] typeTarget, object param, CultureInfo culture)
        {
            return null;
        }
    }
}
